package com.ttt.controller;
/*
*
*
*
* 健康管理模块
 */

import com.fasterxml.jackson.core.JsonProcessingException;
import com.ttt.servicer.impl.SoilHealthImpl;
import com.ttt.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/healthManager")
@CrossOrigin
public class HealthManagerController {


    @Autowired
    private SoilHealthImpl soilHealth;

    //获取土壤健康信息
    @PostMapping("/getSoilHealthInfo")
    public Result getSoilHealthInfo() throws JsonProcessingException {

        //调用service的方法
        Result result = soilHealth.findSoilHealthInfo();

        return result;
    }


    @PostMapping("/getOnlineEquip")
    //获取设备的在线数,掉线数
    public Result getOnlineEquip() throws JsonProcessingException {

        Result result = soilHealth.findOlineEquip();
        return result;
    }


}
